package com.recipeexchange

import com.recipeexchange.domain.LiveComment

class CoverliveController {

    def scaffold = true

    def index = { }

    def add = {
        LiveComment liveComment = new LiveComment(params)
        liveComment.allowed = true
        liveComment.save()
        render template:'/coverlive/liveComment', model:[liveComment: liveComment]
    }

	def allowed = {
		LiveComment liveComment = LiveComment.get(params.id)
		liveComment.properties = params

		liveComment.save()
		render 'ohai'
	}


    def chat = {
        def chats = LiveComment.findAllByConfirmedAndAllowed(true, true)
        [chats: chats]
    }

    def listAllNonconfirmed = {
        def nonConfirmed = LiveComment.findAllByConfirmedAndAllowed(false, true)
        [nonConfirmed: nonConfirmed]
    }
}
